<?php
require './model/Db.php';
$Db = Db::getInstance();
$user_data = $Db->islogin();
if($user_data){
	//关注和粉丝
$my_follow = json_decode($user_data['my_follow'])->uids;
$follow_me = json_decode($user_data['follow_me'])->uids;
$my = [];
$me = [];
foreach ($my_follow as $uid) {
	$data = $Db->find([
		table => ['bbs_user'],
		field => 'id,user',
		where => "id = {$uid}"
	])[0];
	$my[] = $data;
}
foreach ($follow_me as $uid) {
	$data = $Db->find([
		table => ['bbs_user'],
		field => 'id,user',
		where => "id = {$uid}"
	])[0];
	$me[] = $data;
}
$isExist = $Db->find([
	table => ['bbs_user'],
	where => "id = {$_GET['to']}"
])[0];

}else{
	$msg = '未登录,请先登录';
	$reurl = 'login.php';
	$img_type = 'err';
	include './view/skip.html';
	exit();
}


$Db->close();
$web_title = '私信';
$css = [
	'public/css/my-bootstrap.min.css',
	'public/css/selfmail.all.min.css'
];
include './view/header.html';
include './view/selfmail.all.html';
include './view/footer.html';